
<div class="panel panel-default">
<div class="panel-heading">
   Empresa
</div>

 <div class="panel-body">
 
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'empresa-form',
	'enableAjaxValidation'=>false,
		'htmlOptions'=>array(
				'class'=>'form-horizontal',
		),
)); ?>

	<p class="text-muted"> <small>Fields with <span class="required">*</span> are required. </small></p>
	
	
	
	

	<?php echo $form->errorSummary($model); ?>
	
	
	<div class="col-md-8 col-xs-12 col-sm-12">
	<div class="panel">
			
			
			<div class="panel-body">
			<div class="table-responsive">
					  <table class="table">
					    <tr>
					    	<td>ID</td>
					    	<td><strong><?php echo $model->ID_EMPRESA; ?></strong></td>
					    </tr>
					    <tr>
					    	<td>Nombre o razón social</td>
					    	<td><strong><?php echo $model->NOMBRE_RAZON_SOCIAL; ?></strong></td>
					    </tr>
					    <tr>
					    	<td>RFC</td>
					    	<td><strong><?php echo $model->RFC; ?></strong></td>
					    </tr>
					    <tr>
					    	<td>Contacto</td>
					    	<td><strong><?php echo $model->CORREO_ELECTRONICO; ?> <br />
					    				<?php echo $model->TELEFONO; ?>
					    		</strong></td>
					    </tr>
					  </table>
				</div>	
			</div>
		
	</div>
	</div>
	
	
	<div class="col-md-6 col-xs-12 col-sm-12">
	<div class="panel panel-primary">
			<div class="panel-heading">
			   Representante legal
			</div>
			
			<div class="panel-body">
			
				<div class="table-responsive">
					  <table class="table">
					    <tr>
					    	<td class="text-muted">ID</td>
					    	<td><strong><?php echo ($model->iDREPRESENTANTELEGAL===null)? '': $model->iDREPRESENTANTELEGAL->ID_REPRESENTANTE_LEGAL; ?></strong></td>
					    </tr>
					    <tr>
					    	<td class="text-muted">Nombre</td>
					    	<td><strong><?php echo ($model->iDREPRESENTANTELEGAL===null)? '': $model->iDREPRESENTANTELEGAL->NOMBRE; ?></strong></td>
					    </tr>
					    <tr>
					    	<td class="text-muted">Correo Electronico</td>
					    	<td><strong><?php echo ($model->iDREPRESENTANTELEGAL===null)? '': $model->iDREPRESENTANTELEGAL->CORREO_ELECTRONICO; ?></strong></td>
					    </tr>
					    <tr>
					    	<td class="text-muted">Telefono contacto</td>
					    	<td><strong><?php echo ($model->iDREPRESENTANTELEGAL===null)? '': $model->iDREPRESENTANTELEGAL->TELEFONO; ?></strong></td>
					    </tr>
					  </table>
				</div>			
			</div>
			<div class="panel-footer">
				
				
							<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
                              Seleccionar
                            </a>
                            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                            <h4 class="modal-title" id="myModalLabel">Representantes disponibles en su sistema</h4>
                                        </div>
                                        <div class="modal-body">
                                         <?php echo $this->renderPartial('_searchRepresentantes', array('dataProvider'=>$representantesData,'model'=>$model)); ?>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
			</div>
	</div>
	</div>
	
	<div class="col-md-6 col-xs-12 col-sm-12">
	<div class="panel panel-info">
			<div class="panel-heading">
			   Usuarios
			</div>
			
			<div class="panel-body">
			<div class="table-responsive">
					  <table class="table">
					  <thead>
					  	<tr>
					  		<th>#</th>
					  		<th>Nombre</th>
					  		<th>E-MAIL</th>
					  		<th>ROL</th>
					  		<th>Estatus</th>
					  	</tr>
					  </thead>
					  <tbody>
					    <?php foreach ($model->usuarios as $user){?>
					    <tr>
					    	<td><?php echo $user->uSER->id ;?></td>
					  		<td><?php echo $user->uSER->username ;?></td>
					  		<td><?php echo $user->uSER->email ;?></td>					  		
					  		<td>Operador</td>
					  		<td><?php echo $user->uSER->status;?></td>
					   </tr>
					    
					    <?php }?>
					    </tbody>
					  </table>
				</div>	
			</div>
			<div class="panel-footer">
				<a href="#" class="btn btn-info" data-toggle="modal" data-target="#userModal" id="userButton">
                              Seleccionar
                            </a>
                            <div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                            <h4 class="modal-title" id="myModalLabel">Representantes disponibles en su sistema</h4>
                                        </div>
                                        <div class="modal-body">
                                         <?php echo $this->renderPartial('_searchUsuarios', array('dataProvider'=>$usuariosData,'model'=>$model)); ?>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
			</div>
	</div>
	</div>
	

<?php $this->endWidget(); ?>

</div>

<div class="panel-footer">
Si necesita ayuda con este tema  puede consultarla <a href="#">aquí</a>
</div>

</div>